package cloud.xlh.exceptionhandle.service.impl;

import cloud.xlh.exceptionhandle.service.CommonExceptionAssert;
import cloud.xlh.exceptionhandle.service.IResponseEnum;
import lombok.AllArgsConstructor;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/1/3 10:05
 * @ Description: Controller上一层相关异常  公共异常枚举
 */
@AllArgsConstructor
public enum CommonExceptionEnum implements IResponseEnum, CommonExceptionAssert {

    SERVERERROR(0001, "服务异常"),

    /**
     * IllegalAccessException
     */
    ILLEGALACCESSEXCEPTION(0002, "不可反射访问私有资源"),
    /*
    * InvocationTargetException
    * */
    INVOCATIONTARGETEXCEPTION(0003 , "调用目标异常");
    /**
     * 返回码
     */
    private int code;
    /**
     * 返回消息
     */
    private String message;

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
